<?php defined('MYLITS') ? '' : exit('No direct script access allowed'); ?>
<form class="form ajax target-popup-content" action="<?= $urlAction ?>" method="post" class="form-horizontal" role="form">
    <input type="hidden" name="core_user_id" value="<?=  isset($encUserId) ? $encUserId : ''?>"/>
    <div class="form-group">
        <label class="col-sm-3 control-label"><?= Mylits_Language::getText('name') ?></label>
        <div class="col-sm-9">
            <input name="core_user_name" type="text" class="form-control" placeholder="<?= Mylits_Language::getText('name') ?>" value="<?= isset($core_user_name) ? $core_user_name : '' ?>">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><?= Mylits_Language::getText('username') ?></label>
        <div class="col-sm-9">
            <input name="core_user_username" type="text" class="form-control" placeholder="<?= Mylits_Language::getText('username') ?>" value="<?= isset($core_user_username) ? $core_user_username : '' ?>">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><?= Mylits_Language::getText('email') ?></label>
        <div class="col-sm-9">
            <input name="core_user_email" type="email" class="form-control" placeholder="<?= Mylits_Language::getText('email') ?>" value="<?= isset($core_user_email) ? $core_user_email : '' ?>">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><?= Mylits_Language::getText('password') ?></label>
        <div class="col-sm-9">
            <input name="core_user_password" type="password" class="form-control" placeholder="<?= Mylits_Language::getText('password') ?>">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><?= Mylits_Language::getText('confirm_password') ?></label>
        <div class="col-sm-9">
            <input name="core_user_cpassword" type="password" class="form-control" placeholder="<?= Mylits_Language::getText('confirm_password') ?>">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><?= Mylits_Language::getText('group') ?></label>
        <div class="col-sm-9" style="padding-top: 7px">
            <?php foreach ($groupList as $group): ?>
                <div>
                    <?php
                    $check = "";
                    if(isset($userGroupList) && in_array($group['core_usergroup_id'], $userGroupList)){
                        $check = 'checked="checked"';
                    }
                    ?>
                    <input <?=$check?> value="<?= $group['core_usergroup_id'] ?>" type="checkbox" name="group[]"/>
                    <label><?= $group['core_usergroup_name'] ?></label>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"></label>
        <div class="col-sm-9">
            <input style="margin-top: 10px; padding: 10px" class="btn" type="submit" value="<?= Mylits_Language::getText('submit') ?>">
        </div>
    </div>
</form>

<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('.popup-content').scrollTop(0);
<?php if ($addResult): ?>
            var urlList = "<?= $urlList ?>";
            setTimeout(function() {
                setContent(jQuery('.main-component'), "<?= $urlList ?>");
                popupClose();
            }, 1000);
<?php endif; ?>
    });
</script>